Skip to content

Fix GPU CI: device-aware RNG in flavour-levels test - #519

Merged
theoheimel merged 1 commit into
mainfrom
fix-flavor-levels-gpu-ci
Nov 21, 2026
Merged

theoheimel merged 1 commit into
mainfrom
fix-flavor-levels-gpu-ci

Conversation

@theoheimel

Copy link
Copy Markdown
Contributor

GPU CI (manneback CUDA, lemaitre4 HIP) has failed on main since #426: 5 tests in madspace/tests/test_discrete_flavor_levels.py raise Expected a 'cuda' device type for generator but found 'cpu'.

The GPU runs make CUDA the default device for new tensors, but the test seeded with torch.Generator(), which is CPU-only. The test now uses the madspace_testing helpers (generator, rand, randn, randint), which draw on the CPU and move to the test device. Test-only change.

Passes on CPU locally (6 passed); the GPU jobs on this PR should confirm the fix.

…pers

torch.Generator() is CPU-only, but the GPU runs set the default device to
cuda, so torch.rand(..., generator=g) failed. Use the madspace_testing
helpers, which draw on the CPU and move to the test device.
@theoheimel
theoheimel merged commit 77e8b86 into main Nov 21, 2026
71 of 72 checks passed
@theoheimel
theoheimel deleted the fix-flavor-levels-gpu-ci branch November 21, 2026 11:41
@github-actions

Copy link
Copy Markdown
Contributor

How CI reacts to this PR

  • Not a draft: the full CI runs automatically when the PR is opened and on every push.
  • Draft: only the unittest and IOtest workflows run. Mark the PR "Ready for review" to start the full CI.
  • run-ci label: while this label is on the PR, every job keeps running after a failure, so you see all failures. Without it, the first failing job cancels the other runs of that commit.
  • Closing or merging: the unfinished CI runs of this PR are cancelled. A merge gets its own run on main.
  • Pushes to main: the full CI runs after each merge.
  • Other branches: run CI only through workflow_dispatch.
  • Forks: the runs use a read-only token, so they cannot cancel each other.
  • Merge: a green CI and one approval are required to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant